package com.centit.framework.ip.templateFile.service.impl;

import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.centit.framework.ip.templateFile.dao.TemplateFileDao;
import com.centit.framework.ip.templateFile.po.TemplateFile;
import com.centit.framework.ip.templateFile.service.TemplateFileManager;
import com.centit.framework.jdbc.dao.DatabaseOptUtils;
import com.centit.support.database.utils.PageDesc;
import com.centit.framework.jdbc.service.BaseEntityManagerImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Propagation;
/**
 * TemplateFile  Service.
 * create by scaffold 2018-05-17 
 * @author codefan@sina.com
 * C_TEMPLATE_FILEnull   
*/
@Service
public class TemplateFileManagerImpl 
		extends BaseEntityManagerImpl<TemplateFile,String,TemplateFileDao>
	implements TemplateFileManager {

	public static final Log log = LogFactory.getLog(TemplateFileManager.class);

	
	private TemplateFileDao templateFileDao ;



	@Resource(name = "templateFileDao")
    @NotNull
	public void setTemplateFileDao(TemplateFileDao baseDao)
	{
		this.templateFileDao = baseDao;
		setBaseDao(this.templateFileDao);
	}
	
/*
 	@PostConstruct
    public void init() {
        
    }
 	
 */
	@Override
    @Transactional(propagation=Propagation.REQUIRED) 
	public JSONArray listTemplateFilesAsJson(
            String[] fields,
            Map<String, Object> filterMap, PageDesc pageDesc){
		  return null;
	}
	@Override
	public JSONArray getAsJsonBySql(String sql, String[] params) {
        JSONArray infos=DatabaseOptUtils.listObjectsBySqlAsJson(baseDao,sql,params);
		return infos;
	}
}

